﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="TourImageAE.aspx.cs" Inherits="Modules_Tour_TourImageAE" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">    
    <%--------------------------%>
    <div class="header" style="width: 1080px; text-align: left">
            THÊM HÌNH ẢNH
            <div class="content-IE">                
    <table class="adminContent">
        <tr>
            <td class="adminTitle">Title
            </td>
            <td class="adminData">
                <asp:TextBox runat="server" ID="txtName" CssClass="adminInput" />
            </td>
        </tr>

        <tr id="trImage" runat="server">
            <td class="adminTitle"></td>
            <td colspan="2">
                 <telerik:RadScriptManager ID="RadScriptManager1" ScriptMode="Release" runat="server">
    </telerik:RadScriptManager>
                <div style="float: left; width: 80px; height: 80px; border: solid thin orange;">
                    <asp:Image ID="imgThumb" runat="server" EnableViewState="true" AlternateText="Ảnh đại diện"
                        ToolTip="Ảnh đại diện tour" Width="80px" Height="80px" />
                    <asp:HiddenField ID="hdfimgImageTour" runat="server" />
                </div>
                <div style="float: left; width: 300px;">
                    &nbsp;
                                <telerik:dialogopener runat="server" id="DialogOpener1"></telerik:dialogopener>
                    <input type="button" id="btnSelectThumb" value="Chọn" style="width: 40px;" onclick="selectThumb()" />
                    <input type="button" id="btnClearThumb" value="Xóa" style="width: 40px;" onclick="clearThumb()" />
                </div>
            </td>
        </tr>
    </table>
    <div class="section-header">       
        <div class="options">
            <asp:Button ID="btnSave" runat="server" CssClass="adminButtonBlue" Text="Cập nhật" ToolTip="Save"
                OnClick="btnSave_Click" />

            <a href="TourImageList.aspx" style="cursor: pointer">
                <input type="button" class="adminButtonBlue" value="Danh sách hình ảnh" />
            </a>&nbsp;
        </div>
    </div>
            </div>
            <div class="clear">
            </div></div>
    <%--------------------------%>
    <script type="text/javascript">

        function selectThumb() {
            var radEditorContent = $find("<%= DialogOpener1.ClientID %>");
           radEditorContent.openUrl("/Admin/Modules/FileManager/InsertFTPImage.aspx", {}, 800, 600, selectThumbComplete, null, "custom link manager", true);
       }

       function clearThumb() {
           $('#<%= imgThumb.ClientID %>').attr("scr", "");
                        $('#<%= hdfimgImageTour.ClientID %>').val("");
                    }
                    var selectThumbComplete = function (sender, args) {
                        if (!args.IsCancel) {
                            if (args.Url.length > 0) {
                                var img = document.getElementById("<%= imgThumb.ClientID %>");
                                img.src = args.Url;
                                $('#<%= hdfimgImageTour.ClientID %>').val(args.Url);
                               // alert($('#<%= hdfimgImageTour.ClientID %>').val());

                            }
                        }
                    }

    </script>
</asp:Content>
